home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
program
/
progem.lzh
/
wind17.prf
< prev
next >
Wrap
Text File
|
1987-06-23
|
23KB
|
474 lines
.!****************************************************************************
.!
.! ANTIC PUBLISHING INC., COPYRIGHT 1985. REPRINTED BY PERMISSION.
.!
.! ** Professional GEM ** by Tim Oren
.!
.! Proff File by ST enthusiasts at
.! Case Western Reserve University
.! Cleveland, Ohio
.! uucp : decvax!cwruecmp!bammi
.! csnet: bammi@case
.! arpa : bammi%case@csnet-relay
.! compuserve: 71515,155
.!
.!****************************************************************************
.!
.!
.!****************************************************************************
.!
.! Begin Part XVII
.!
.!****************************************************************************
.!
.PART XVII PC/ST Resource Converter
.PP
This the seventeenth installment of ST PRO GEM, the
first to feature a complete GEM application. The program
converts resource files between the ST (68000) and IBM PC
(Intel) formats used by the respective versions of GEM and
the Resource Construction Set.
.PP
The Resource Converter will, for the most part, be of
direct use only if you are doing cross-development of GEM
software on these two systems. In this case, you will want
to read this entire article, starting with the "What It Does"
heading. You may also be interested in an article on PC/ST
conversion written by Mark Skapinker of Batteries Included,
which appears in the Fall issue of START magazine (available
September 1986).
.PP
If you are not doing cross machine development, you can
still get something out of this column. Reading the program
code and following the discussion, you will find practical
examples of using GEM dialogs and following the internal
structure of a resource file. Finally, there is a good deal
of standard code for GEM initialization, AES utility
functions, and GEMDOS file handling which you can extract for
your own uses. If you fall in this category, skip the first
parts of the column, and resume reading at the "How it Works"
heading.
.PP
The download for this column is a set of source and
binary files located on DL3 of the ATARI16 SIG, PCS-58. The
files and their contents are:
RCMAIN.C - Download and rename to RSCVMAIN.C
This is the C source for main routine
RCFILE.C - Download and rename to RSCVFILE.C
This is the C source of GEMDOS utilities
RCLIB.C - Download and rename to RSCVLIB.C
C source of AES utility functions
RSCONV.PRG - Linked binary of converter
RSCONV.RSC - Binary resource image (ST format)
RSCONV.DFN - Symbol file for resource (ST format for
RCS 2.0)
RSCONV.H - Object/tree name file for resource
RLINK.SH - Download and rename to RSCVLINK.SH
C-shell script for linking RSCONV
SYLINK.SH - Download and rename to SYMLINK.SH
Another script, used by RSCVLINK.SH
.PP
The final two files will be of use only if you are using Dave
Beckemeyer's Micro C-Shell environment. If not, you can
simply translate them to .BAT and/or .INP form for use with
the Atari batch program and linker.
.SH WHAT IT DOES
A converter program is necessary because of the
differing order of storage on the 68000 and Intel chips: the
order of significance of bytes within words is reversed, as
well as the order of words within long (32-bit) quantities.
Attempting to load an unconverted resource on a GEM system
with the other architecture will result in a crash, because
all of the pointer and integer fields will be incorrect.
.PP
In addition, the format of symbol definition (DEF) files
differs between the PC and ST implementations of the RCS in
its first version. In the latest version from DRI, the
formats do correspond, and the files now carry an extent name
of DFN. However, the byte swapping problem must be corrected
in either format for the symbols to be correctly loaded.
As final touch, the converter also checks to be sure
that a resource being loaded from the PC has its bit images
synchronized to an even byte boundary. If this is not
corrected, the ST will suffer a bus error when attempted to
address the images with a word type operation, which will
certainly happen in either the RCS or the application itself
on the target system.
.SH OPERATION
When the Resource Converter loads, it presents an
initial dialog box. (The converter does not use the menu
bar.) The dialog has action buttons at the bottom labelled
"Help", "Convert" and "Quit". Clicking the Help button will
obtain a screen which summarizes these operating
instructions. The Quit button terminates the program.
Clicking Convert initiates the program's action, according to
the options you have set in the rest of the dialog.
.PP
The top two buttons in the dialog establish the
direction of the conversion. If you have built a resource on
the PC and want to move it to the ST, click Intel->68000. If
you are moving the file from the ST to the PC, click
68000->Intel.
.PP
The next two lines in the dialog establish the file
extent names which will be used for the conversion. The
input extent names are always on the left, no matter which
conversion mode you selected above. By default, they are RSC
and DEF. The output extents, on the right, are RS2 and DF2
by default. The RSC/RS2 file extents are used for the
resource, and DEF/DF2 extents are for the symbol file. Be
careful that the input files you use are actually of the type
(Intel or 68000) which you specified. If you get it
backwards, the ST will most likely crash, though the input
files will not be harmed.
.PP
The three buttons below the file extents determine the
format of the input and output symbol files. If you click on
DEF, the Resource Converter will assume that the input and
output symbol files are in the old (that is, version 1.1)
format used by the RCS. If you click on DFN, the program
expects the new (version 2.0) symbol format. If the input
symbol file extent is still set to "DEF", clicking this
button will also change it appropriately. (Note that the DEF
and DFN formats are in fact IDENTICAL on the PC ONLY. To
"change formats" ON THE PC, you need only change the file's
extent name, for example, rename FOOBAZ.DEF to FOOBAZ.DFN.
On the ST, there is a real difference,and you must use the
DRI DEF2DFN.PRG utility to go from old to new.)
.PP
The last button option is (OFF). Clicking this button
disables the symbol file conversion. You may use this option
to keep better control over versions of your resource. By
establishing the main version on either the PC or ST, and
converting only the resource file, not the symbols, you can
ensure that no one will use the RCS on the destination
machine to create a version which is different from the
source.
.PP
When the Convert button is clicked to begin execution,
the standard Item Selector is displayed. Use it to find and
pick the input resource file which you want to convert. The
Converter will use its main filename, substituting the
various extents, to find the input definition file, and
produce the output file names. If the definition file cannot
be found in the same directory under the generated name, you
will be presented with an alert, asking you to abort the
conversion, continue without the symbol file, or specify a
new name and/or directory for the file. If the output names
coincide with existing files, they will be overwritten.
.PP
While the conversion operation is occurring, a progress
indicator box will be displayed on the screen, with text
messages indicating the current phase of the operation. When
the conversion is complete, you are returned to the initial
dialog, where you may quit or perform another conversion.
.PP
One last note on conversion, with a caution: it is
possible to move files between Intel and 68000 even if you
have two different versions of the Resource Construction Set,
for instance, Version 2.0 on the PC and Version 1.1 on the
ST. In this situation, you can take advantage of the
identity between symbol file formats on the PC. Make a copy
of the PC symbol file into another file with the DEF extent,
and run the converter. The output should load on the ST
version correctly. Howeve